
import FCVector
VIEWNUM = 20
MAX_LEAF_SIZE = 10
RVO_EPSILON = 0.00001
RADIUS = 8
PI = 3.141592
loddist = [0,0,0]
arrangecube = []

arrangeCubeMode = False
#Singleton Pattern
class Singleton(object):
    _instance = None
    def __new__(cls, *args, **kwargs):
        if not cls._instance:
            cls._instance = super(Singleton, cls).__new__(cls, *args, **kwargs)

class AgentTreeNode:
    def __init__( self ):
	    self.Begin = 0
	    self.End = 0
	    self.Left = 0
	    self.MaxX = 0
	    self.MaxY = 0
	    self.MinX = 0
	    self.MinY = 0
	    self.Right = 0
	
class ObstacleTreeNode:
    def __init__( self ):
	    self.pObstacle = None
	    self.pLeft = None
	    self.pRight = None
	
class Line:
    def __init__( self ):
	    self.Point = FCVector.vector2D(0, 0)
	    self.Direction = FCVector.vector2D(0, 0)
	
class Wall:
    def __init__( self, to, fromv ):
        self.vA = to
        self.vB = fromv
        temp =  FCVector.normalize(self.vB-self.vA)
        self.vN = FCVector.vector2D(-temp.y,temp.x) 	   
         
    def TO(self):
        return self.vA
        
    def FROM(self):
        return self.vB
        
    def normal(self):
	    return self.vN